package com.ianmoone.lintcode;

import java.util.Scanner;

public class Program2 {
	
	public static int FindGreatestSumOfSubArray(int[] array) {
		         int [][]dataArray= new int[array.length][array.length];
		         for (int i = 0; i < array.length;i++) {
		             dataArray[i][i] = array[i];
		         }
		         
		         int max = Integer.MIN_VALUE;
		         for (int i = 0 ;i < array.length; i++) {
		             if (array[i] > max) {
		                 max = array[i];
		             }
		         }
		         for (int step = 1;step < array.length; step++) {
		             for (int i = 0; i < array.length; i++) {
		                 if (i+step < array.length) {
		                     dataArray[i][i+step] = dataArray[i + 1][i+step] + dataArray[i][i]; 
		                     if (dataArray[i][i + step] > max) {
		                         max = dataArray[i][i + step];
		                     }
		                 }
		             }
		         }
	
		         return max;
		     }
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int num = scanner.nextInt();
		int array[] = new int[1];
		for(int i =0 ;i<num ; i++){
			array[i]=scanner.nextInt();
		}
		
	}
}
